﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
namespace WorldExchange
{
    public class Exchange
    {

        #region "Member variable"
        private Price _AUD;
        private Price _CAD;
        private Price _CHF;
        private Price _DKK;
        private Price _EUR;
        private Price _GBP;
        private Price _HKD;
        private Price _INR;
        private Price _JPY;
        private Price _KRW;
        private Price _KWD;
        private Price _MYR;
        private Price _NOK;
        private Price _SEK;
        private Price _SGD;
        private Price _THB;
        private Price _USD;

        private string _LinkService;
      
        
        #endregion

        #region "Property"
        public string LinkService
        {
            get { return _LinkService; }
            set { _LinkService = value; }
        }
       
      
       
        public Price AUD
        {
            get { return _AUD; }
            set { _AUD = value; }
        }
        public Price CAD
        {
            get { return _CAD; }
            set { _CAD = value; }
        }
        public Price CHF
        {
            get { return _CHF; }
            set { _CHF = value; }
        }
        public Price DKK
        {
            get { return _DKK; }
            set { _DKK = value; }
        }
        public Price EUR
        {
            get { return _EUR; }
            set { _EUR = value; }
        }
        public Price GBP
        {
            get { return _GBP; }
            set { _GBP = value; }
        }
        public Price HKD
        {
            get { return _HKD; }
            set { _HKD = value; }
        }
        public Price INR
        {
            get { return _INR; }
            set { _INR = value; }
        }
        public Price JPY
        {
            get { return _JPY; }
            set { _JPY = value; }
        }
        public Price KRW
        {
            get { return _KRW; }
            set { _KRW = value; }
        }
        public Price KWD
        {
            get { return _KWD; }
            set { _KWD = value; }
        }
        public Price MYR
        {
            get { return _MYR; }
            set { _MYR = value; }
        }
        public Price NOK
        {
            get { return _NOK; }
            set { _NOK = value; }
        }
        public Price SEK
        {
            get { return _SEK; }
            set { _SEK = value; }
        }
        public Price SGD
        {
            get { return _SGD; }
            set { _SGD = value; }
        }
        public Price THB
        {
            get { return _THB; }
            set { _THB = value; }
        }
        public Price USD
        {
            get { return _USD; }
            set { _USD = value; }
        }
        #endregion

       
        #region "Method"
        /// <summary>
        /// Dữ liệu truy xuất có đang được cache hay không?
        /// </summary>
        /// <returns></returns>
        public virtual void getExchange()
        {
            
        }

        public void writeToDB() { 
        
        
        }
        
        #endregion

        protected void setNewValue()
        {
            Exchange.UniqueInstance.AUD = this.AUD;
            Exchange.UniqueInstance.CAD = this.CAD;
            Exchange.UniqueInstance.CHF = this.CHF;
            Exchange.UniqueInstance.DKK = this.DKK;
            Exchange.UniqueInstance.EUR = this.EUR;
            Exchange.UniqueInstance.GBP = this.GBP;
            Exchange.UniqueInstance.HKD = this.HKD;
            Exchange.UniqueInstance.INR = this.INR;
            Exchange.UniqueInstance.JPY = this.JPY;
            Exchange.UniqueInstance.KRW = this.KRW;
            Exchange.UniqueInstance.KWD = this.KWD;
            Exchange.UniqueInstance.MYR = this.MYR;
            Exchange.UniqueInstance.NOK = this.NOK;
            Exchange.UniqueInstance.SEK = this.SEK;
            Exchange.UniqueInstance.SGD = this.SGD;
            Exchange.UniqueInstance.THB = this.THB;
            Exchange.UniqueInstance.USD = this.USD;
        }

        #region Singleton
        static Exchange instance = new Exchange();

        // Public static property to get the object
        public static Exchange UniqueInstance
        {
            get { return instance; }
        }
        #endregion Singleton
    }
}
